<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return['role']=$_SESSION['role'];
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
    $orderby='createtime desc';
	$total='';
	$params['type']=intval($_RQ['type'])?:2;
	$return['type']=$_RQ['type'];
	if($return['type']==3){
		$return['tips']='拼中人赠送拼团金，累积N次拼中后可：%兑换成积分，%兑换成金豆，%兑换成倍财金！具体比例由《拼团区》的商品决定！';
	}
	$return['typetitle']=$this->feelog_type[$return['type']];
	$return['list']=pdo_getslice('jy_ad_feelog',$params,array($pindex,$psize),$total,$fields,'',$orderby);	
	foreach($return['list'] as &$v){
			$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
			$v['typetitle']=$this->feelog_type[$v['type']];
			if($v['type']==3){
				$group=pdo_get('jy_ad_group',array('id'=>$v['groupid'],'uniacid'=>$_SESSION['uniacid']));
				if($group['dui_jifen1']){
					$v['jifen1']=$group['dui_jifen1']*$v['fee']/100;
				}
				if($group['dui_jifen3']){
					$v['jifen3']=$group['dui_jifen3']*$v['fee']/100;
				}
				if($group['dui_licai']){
					$v['baofee']=$group['dui_licai']*$v['fee']/100;
				}
			}
	}
	set_html('title',$return['typetitle'].'记录');
	exi($return);
}
